package com.example.yjwj.slice;

import com.example.yjwj.ResourceTable;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;
import ohos.agp.components.Component;
import ohos.agp.components.Text;

public class MainAbilitySlice02 extends AbilitySlice {
    Text text01;
    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);
        super.setUIContent(ResourceTable.Layout_ability_main02);
        //.获取text对象
        Text text01 = (Text) this.findComponentById(ResourceTable.Id_text_02_01);
//.设置单击事件
        text01.setClickedListener(this::clickedListenerText01);
    }
        private void clickedListenerText01(Component component) {
            text01.startAutoScrolling();
        }
    @Override
    public void onActive() {
        super.onActive();
    }

    @Override
    public void onForeground(Intent intent) {
        super.onForeground(intent);
    }
}
